#include <head.h>

typedef struct str
{
    char name[23];
    char sex[5];
    int age;
    int id;
}str;


int main(int argc, char const *argv[])
{
    str * data_ptr;
    // 挂载内存
    data_ptr = (str *)shmat( 2261002 , NULL , 0);

    str data = {
        .name = "张1", .sex = "男", .age = 18, .id = 1
    };

    memcpy(data_ptr , &data , sizeof(data));
    while (1)
    {
        sleep(1);
    }
    // 卸载内存
    shmdt((void *)data_ptr);


    

    return 0;
}

